<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery.min.js"></script>
    <script type="text/javascript">
        $().ready(function(){
            $.ajax({
                type: "POST",
                url: "cart/findCartByUid.do",
                dataType: "JSON",
                data: {
                     "uid":"1"
                },
                success: function(data) {
                    for(var i=0;i<data.length;i++){
                        var dataStr = " <input type=\"checkbox\" value=\""+data[i].pid+"\" name=\""+data[i].pid+"\"><input type=\"text\" name=\"carts["+i+"].id\" value=\""+data[i].id+"\"><input type=\"number\" name=\"carts["+i+"].buynum\" value=\""+data[i].buynum+"\"><br>";
                        $("#biaodan").append(dataStr);
                    }
                    var strss = "收货人：<input type=\"text\" name=\"name\"></br>\n" +
                        "    电话：<input type=\"text\" name=\"telephone\"></br>\n" +
                        "    地址：<input type=\"text\" name=\"address\"></br>\n" +
                        "    购买人：<input type=\"text\" name=\"uid\"></br>";
                    $("#biaodan").append(strss);
                    $("#biaodan").append("<input type=\"submit\" value=\"提交订单\"></br>");
                }
        });
        });
    </script>
</head>
<body>
<form action="/orders/placeOrder.do" method="post" id="biaodan">

</form>
<input type="image"  src="http://120.79.240.142:8080/images/1488542386-2_u_2.jpg">
<input type="image"  src="http://120.79.240.142:8080/images/test.jpg">
<button  value="点一下" onclick="findPro()" id="anniu"  style="height: 20px; width: 40px" />
<script type="text/javascript">
    function findPro() {
        $.ajax({
            type: "POST",
            url: "/product/findProductById.do",
            dataType: "JSON",
            data: {
                "id":"d1"
            },
            success: function(data) {
                var dataStr = " <input type=\"image\" src=\""+data.image+"\"><br>";
                $("#anniu").append(dataStr);
            }
        });
    }
</script>
</body>
</html>